Skip to content

simplify Zeta23, removed ~30.3% of lean source lines - #65

Open
muayyad-alsadi wants to merge 1 commit into
anthropics:mainfrom
muayyad-alsadi:zeta23-simplify
Open

muayyad-alsadi wants to merge 1 commit into
anthropics:mainfrom
muayyad-alsadi:zeta23-simplify

Conversation

@muayyad-alsadi

@muayyad-alsadi muayyad-alsadi commented Nov 29, 2026 •

Copy link
Copy Markdown

details in zeta23/alsadi-simplification.md

Zeta23 Simplification Report

Summary

We measure all .lean files in zeta23/ (excluding .lake/ and docbuild/).
We report two numbers for each snapshot:

  • Total lines: every line in every .lean file.
  • Code LOC: source lines only, with blank lines and comments (-- and /- ... -/) removed.
Snapshot Files Total lines Code LOC Total lines saved Code LOC saved
Baseline (main) 326 103,032 80,949 — —
Current 296 74,239 56,419 28,793 (27.9%) 24,530 (30.3%)

From baseline to current, we removed 24,530 Code LOC (30.3%) and 28,793 total lines (27.9%).

All three headline theorem groups stay complete, with no new sorry and no new axioms:

  1. Solution.lean: 17 Palomar theorems.
  2. Solution/XiPrime.lean: 6 XiPrime theorems.
  3. Zeta23/PairCeiling/: 11 PairCeiling theorems.

Where the Savings Came From

From baseline to current, the net 24,530 Code LOC reduction splits into three parts:

Category Files Code LOC change Total lines change
Deleted files 38 -11,267 -13,906
Kept files (net) 288 -16,193 -18,598
Added shared / split files 8 +2,930 +3,711
Net total saved -30 -24,530 -28,793

Deleted Files (38 files, 11,267 Code LOC saved)

We deleted files that no headline theorem used, or files replaced by a shared module.

Deleted file or folder Files Code LOC saved Total lines saved Reason
Zeta23/XiPrime/Hardy/ 22 4,830 6,228 Unused Hardy-Z development
Zeta23/FromPNTPlus/MediumPNT.lean 1 3,334 3,731 Unused upstream file
Zeta23/FromPNTPlus/MellinCalculus.lean 1 943 1,048 Unused upstream file
Zeta23/ThmD/PsiC.lean 1 503 573 Merged into Zeta23/Taper/PsiC.lean
Zeta23/XiPrime/QuarticWindow/ModWindow.lean 1 411 503 Promoted to Zeta23/ThmD/ModWindow.lean
Zeta23/XiPrime/Transfer/W.lean, InputsW.lean 2 320 411 Unused transfer variants
Zeta23/FromPNTPlus/Sobolev.lean 1 282 371 Unused after PNT+ trim
Remaining 9 deleted files 9 644 1,041 Unused helpers, TightMult, CertificateC3
Total deleted 38 11,267 13,906

Top Shrunk Files (288 kept files, 16,193 net Code LOC saved)

File Before (Code LOC) Now (Code LOC) Code LOC saved How it shrank
Zeta23/FromPNTPlus/ZetaBounds.lean 2,694 647 2,047 Kept only declarations used by Zeta23
Zeta23/ThmD/Window.lean 1,629 309 1,320 Replaced custom proofs with shared ThmD/ModWindow.lean
Zeta23/Assembly.lean 1,178 1 1,177 Split into Assembly/{Endgame,Growth,Matrix,Windows}.lean
Zeta23/WeilEF/Effective.lean 844 52 792 Removed unused declarations
Zeta23/FromPNTPlus/ResidueCalcOnRectangles.lean 984 208 776 Kept only declarations used by Zeta23
Zeta23/XiPrime/ExplicitFormula/TestWeight.lean 903 399 504 Removed unused declarations
Zeta23/ThmE/PPChi.lean 873 429 444 Shared prime-pair kernel in PrimeSideB/PPKernel.lean
Zeta23/Taper/Decay.lean 836 395 441 Called shared Taper/PsiC.lean
Zeta23/XiPrime/QuarticWindow/Moments.lean 473 83 390 Used generic moments and autocorrelation in ThmD/ModWindow.lean
Zeta23/ThmE/IntMuChi.lean 600 236 364 Shared integral bounds and removed duplicates
Zeta23/ThmDE/Mult.lean 372 48 324 Unified c = 2 and c = 3 multiplicity endgames
Zeta23/ThmDE/Endgame.lean 353 41 312 Used shared ThmD endgame and pruned unused wrappers
Zeta23/XiPrime/PrimeSide/PP.lean 529 234 295 Shared prime-pair kernel in PrimeSideB/PPKernel.lean
Zeta23/ThmE/MainTermChi.lean 480 208 272 Used generic rvM_main_scaled in RvM/Generic.lean
Zeta23/ThmD/Mult.lean 382 122 260 Unified c = 2 and c = 3 multiplicity endgames
Remaining 273 kept files (net) — — 6,475 Unused declarations, shared helpers, and smaller merges (net of files that grew, such as PrimeSideB/PPKernel.lean +377)
Total kept files (net) 16,193

Added Shared and Split Files (8 files, +2,930 Code LOC)

To replace duplicated proofs, we added 8 shared or split files:

Added file Code LOC Purpose
Zeta23/Assembly/{Endgame,Growth,Matrix,Windows}.lean (4 files) +1,277 Split Assembly.lean and unified c-generic matrix and endgame proofs
Zeta23/ThmD/ModWindow.lean +726 Shared modulated-window engine for ThmD and XiPrime/QuarticWindow
Zeta23/RvM/Generic.lean +501 Shared zero-counting and Riemann–von Mangoldt engine for ζ, χ, and ξ′
Zeta23/Taper/PsiC.lean +340 Shared taper decay engine for Taper/Decay.lean and ThmD
Zeta23/Analytic/BacklundInduction.lean +86 Shared Backlund induction helper for RvM and ThmE
Total added +2,930

What We Merged and Generalized

  1. Modulated windows (ThmD/ModWindow.lean, ThmD/WindowCore.lean, Taper/PsiC.lean):
    We combined the phiD window (ThmD/Window.lean) and the quartic window (XiPrime/QuarticWindow/Moments.lean) onto one ModFactor engine. We unified v and v² Fourier bounds in WindowCore.lean under RealWindow, and merged the repeated psi decay proofs into Taper/PsiC.lean.
  2. Zero counting and Landau bounds (RvM/Generic.lean, WeilEF/Landau.lean, WeilEF/GoodHeights.lean, Defs/Counting.lean):
    We replaced parallel zero-counting, Gamma-side, and Riemann–von Mangoldt proofs across RvM/, ThmE/, and XiPrime/ZeroCount/ with DiscCountData and rvM_main_scaled. We unified the Landau partial-fraction and good-heights proofs under TwoLineLandauData, and moved shared ZeroConfig window lemmas into Defs/Counting.lean.
  3. Assembly, certificates, and endgames (Assembly/Matrix.lean, Assembly/Certificate.lean, ThmD/, ThmE/, ThmDE/, XiPrime/Assembly.lean):
    We unified the c = 2 (simple zeros) and c = 3 (distinct zeros) perturbation, moment, certificate, and endgame proofs into c-generic lemmas, and deleted Assembly/CertificateC3.lean along with unused Cauchy–Schwarz wrappers.
  4. Prime-pair kernels and explicit-formula helpers (PrimeSideB/PPKernel.lean, Analytic/RectangleLogDeriv.lean):
    We generalized the prime-pair kernel for PrimeSideB, ThmE/PPChi.lean, and XiPrime/PrimeSide/PP.lean, and shared contour-rectangle and Backlund helpers across ζ, χ, and ξ′.
  5. Unused code removal:
    We deleted unused modules (XiPrime/Hardy/, MediumPNT.lean, MellinCalculus.lean, Sobolev.lean) and trimmed unused declarations from FromPNTPlus/ and over 100 internal files.

@muayyad-alsadi muayyad-alsadi changed the title simplify, removed ~23% of lean source lines simplify Zeta23, removed ~24% of lean source lines Dec 1, 2026
@muayyad-alsadi
muayyad-alsadi force-pushed the zeta23-simplify branch 2 times, most recently from f858589 to 5ada4cd Compare December 1, 2026 23:00
@muayyad-alsadi muayyad-alsadi changed the title simplify Zeta23, removed ~24% of lean source lines simplify Zeta23, removed ~30.3% of lean source lines Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant